public class NoEnoughPapersException extends Exception {
    private final String studentName;
    private final int expectedQuantity;
    private final int availableQuantity;

    public NoEnoughPapersException(String studentName, int expected, int available) {
        this.studentName = studentName;
        this.expectedQuantity = expected;
        this.availableQuantity = available;
    }

    @Override
    public String getMessage() {
        return "学生 " + studentName + " 希望选论文 " + expectedQuantity + " 篇，但目前只有 "
                + availableQuantity + " 篇可选";
    }
}